package cn.itcast.util;

import java.util.Calendar;
import java.util.Date;

public class DateTimeUtil {
    /**
     * 开发步骤：
     * 1.新建Calendar对象，设置日期
     * 2.设置开市时间
     * 3.设置闭市时间
     */

    public static long openTime = 0l;
    public static long closeTime = 0l;

    static {

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.set(Calendar.HOUR_OF_DAY,9);  //24小时制
        calendar.set(Calendar.MINUTE,30);
        calendar.set(Calendar.SECOND,0);
        openTime = calendar.getTime().getTime();

        calendar.set(Calendar.HOUR_OF_DAY,15);
        calendar.set(Calendar.MINUTE,0);
        closeTime = calendar.getTime().getTime();
    }

    public static void main(String[] args) {
        System.out.println(openTime);
        System.out.print(closeTime);
    }

}
